package com.example.test.common;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

public class RestCommon {
	
	static Logger logger = LoggerFactory.getLogger(RestCommon.class);
	
	public static int getNew(int i) throws RuntimeException{
		if(i == 0) {
			try {
				 i = 1/0;
			} catch (Exception e) {
				logger.error("RestCommon的getNew()方法出现异常！！！"+e.getMessage());
				throw new RuntimeException("出现异常。"+e.getMessage());
			}
		}
		return i;
	}
}
